package com.tte.common.designpattern.abstractfactory;

import com.tte.common.designpattern.service.Place;
import com.tte.common.designpattern.service.Shopping;
import com.tte.common.designpattern.service.impl.ChinaImpl;
import com.tte.common.designpattern.service.impl.RussiaImpl;
import com.tte.common.designpattern.service.impl.USAImpl;

/**
 * 地区工厂
 * @Description: PlaceFactory
 * @Author: DongWH
 * @Date: 2022/1/20 14:50
 * @params *@params $
 */
public class PlaceFactoryAbstract extends AbstractFactory{
    //使用 getShape 方法获取形状类型的对象
    @Override
    public Place getPlace(String place){
        if(place == null){
            return null;
        }
        if(place.equalsIgnoreCase("china")){
            return new ChinaImpl();
        } else if(place.equalsIgnoreCase("russial")){
            return new RussiaImpl();
        } else if(place.equalsIgnoreCase("usa")){
            return new USAImpl();
        }
        return null;
    }
    @Override
    public Shopping getShopping(String shop){
        return null;
    }
}
